package com.linkage.category.web;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.linkage.category.pojo.Category;
import com.linkage.category.service.CategoryService;

/**
 * 
 * @author LuoYunHui
 *
 */
@Controller
@RequestMapping("/category")
public class CategoryController {
	
	@Autowired
    private CategoryService categoryService;
	@RequestMapping(value = "/showCategory", method = RequestMethod.GET)
	public String showCategory(Model model) {
		List<Category> categorys = this.categoryService.queryAll();
		model.addAttribute("categorys", categorys);
		
		return "left";
	}
	
}

